<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMemberTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('member', function (Blueprint $table) {
            $table->increments('id');
            $table -> string('open_id')->nullable()->comment('微信openid');
            $table -> string('phone')->nullable()->comment('手机号');
            $table -> timestamp('birthday')->nullable()->comment('生日');
            $table -> softDeletes();
            $table->timestamps();
        });
        Schema::create('member_coupon', function (Blueprint $table) {
            $table->increments('id');
            $table -> integer('member_id')->default(0)->comment('会员id');
            $table -> string('code')->nullable()->comment('兑换券');
            $table -> timestamp('end_time')->nullable()->comment('有效期');
            $table -> decimal('amount')->nullable()->comment('金额');
            $table -> integer('status')->default(0)->comment('状态');
            $table -> softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
